package com.zzl.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ZSetOperations;

import java.util.HashSet;
import java.util.Set;

/**
 * @ClassName: RedisZsetDemo
 * @Description: GOOD
 * @author: ZZL
 * @date: 2021/9/1  16:27
 */
public class RedisZsetDemo {

    @Autowired
    RedisUtil redisUtil;

    public static void main(String[] args) {
        Set<ZSetOperations.TypedTuple> demo = new HashSet<>();
        RedisZsetDemo rzd = new RedisZsetDemo();
        //System.out.println(demo);
        System.out.println(rzd.test1());
    }

    public Set<ZSetOperations.TypedTuple> test() {
        redisUtil.zSet("养老1",4,1);
        redisUtil.zSet("养老2",4,2);
        redisUtil.zSet("养老3",4,3);
        return redisUtil.getZSetRank("养老1",1,2);
    }

    public long test1() {
        redisUtil.zSet("养老11",4,1);

        return  redisUtil.getZsetScore("养老1",4);
    }
}
